#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int findMaxConsecutiveOnes(int* nums, int numsSize) {
    int i = 0;
    int count = 0;
    int flag = 0;
    int *arr=(int*)malloc(sizeof(int)*numsSize);
    for (i = 0; i < numsSize; i++) {
        arr[i] = 0;
    }
    int k = 0;
    for (i = 0; i < numsSize; i++) {
        if (nums[i] == 1) {
            arr[k] += nums[i];
        }
        else {
            k++;
        }
    }
    int max = arr[0];
    for (i = 0; i < numsSize; i++) {
        if (arr[i] > max)max = arr[i];
    }
    return max;
}
int main() {
    int nums[6] = { 1,0,1,1,0,1 };
    int n = findMaxConsecutiveOnes(nums, 6);
    printf("%d", n);
    return 0;
}